//
//  DetaiHotWindowTableViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/13.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "DetaiHotWindowTableViewCell.h"
#import "GXMacro.h"

@interface DetaiHotWindowTableViewCell ()
@property (nonatomic, strong) UIView *viewOfLine;
@end
@implementation DetaiHotWindowTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _labelOfName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfName];
        _labelOfContent = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfContent];
        _labelOfLikeCount = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfLikeCount];
        _imageOfPerson = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageOfPerson];
        _imageOfContent = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageOfContent];
        
        _buttonOfLike = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:_buttonOfLike];
        _buttonOfShare = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:_buttonOfShare];
        _buttonOfAddToMe = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:_buttonOfAddToMe];
        _buttonOfContract = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_buttonOfContract];
        _viewOfContractPerson = [[UIView alloc] init];
        [self.contentView addSubview:_viewOfContractPerson];
        _viewOfLine = [[UIView alloc] init];
        [self.contentView addSubview:_viewOfLine];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
[_imageOfContent mas_makeConstraints:^(MASConstraintMaker *make) {
    make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
    make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
    make.top.mas_equalTo(self.contentView.mas_top).mas_equalTo(10);
    make.height.mas_equalTo(self.contentView.mas_height).multipliedBy(0.6);
}];
    [_labelOfContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageOfContent.mas_left);
        make.width.mas_equalTo(self.contentView.mas_width).multipliedBy(0.6);
        make.top.mas_equalTo(_imageOfContent.mas_bottom).mas_equalTo(10);
        make.height.mas_equalTo(80);
    }];
    [_viewOfContractPerson mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfContent.mas_right);
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-10);
        make.top.mas_equalTo(_labelOfContent.mas_top);
        make.bottom.mas_equalTo(_labelOfContent.mas_bottom);
    }];
    [_imageOfPerson mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfContent.mas_left);
        make.top.mas_equalTo(_labelOfContent.mas_bottom).mas_equalTo(20);
        make.height.mas_equalTo(60);
        make.width.mas_equalTo(60);
    }];
    [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageOfPerson.mas_right).mas_equalTo(10);
        make.top.mas_equalTo(_labelOfContent.mas_bottom).mas_equalTo(20);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(100);
    }];
    [_buttonOfContract mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_labelOfName.mas_left);
        make.top.mas_equalTo(_labelOfName.mas_bottom).mas_equalTo(10);
        make.width.mas_equalTo(80);
        make.height.mas_equalTo(30);
    }];
    [_buttonOfAddToMe mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.contentView.mas_right).mas_equalTo(-20);
        make.top.mas_equalTo(_imageOfPerson.mas_top).mas_equalTo(10);
        make.height.mas_equalTo(30);
        make.width.mas_equalTo(30);
    }];
    [_buttonOfShare mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(_buttonOfAddToMe.mas_left).mas_equalTo(-20);
        make.width.mas_equalTo(30);
        make.top.mas_equalTo(_buttonOfAddToMe.mas_top);
        make.height.mas_equalTo(30);
    }];
    [_buttonOfLike mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(_buttonOfShare.mas_left).mas_equalTo(-50);
        make.top.mas_equalTo(_buttonOfShare.mas_top);
        make.width.mas_equalTo(30);
        make.height.mas_equalTo(30);
    }];
    [_labelOfLikeCount mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_buttonOfLike.mas_right).mas_equalTo(10);
        make.right.mas_equalTo(_buttonOfShare.mas_left).mas_equalTo(-10);
        make.height.mas_equalTo(20);
        make.top.mas_equalTo(_buttonOfShare.mas_top).mas_equalTo(5);
    }];
    [_buttonOfContract setTitle:@"+ 关注" forState:UIControlStateNormal];
    _buttonOfContract.tintColor = [UIColor colorWithRed:1.000 green:0.000 blue:0.502 alpha:0.752];
    _buttonOfContract.layer.masksToBounds = YES;
    _buttonOfContract.layer.cornerRadius = 5;
    _buttonOfContract.layer.borderWidth = 1;
    _buttonOfContract.layer.borderColor = [[UIColor colorWithRed:1.000 green:0.000 blue:0.502 alpha:0.752] CGColor];
    [_buttonOfShare setImage:[UIImage imageNamed:@"buttonOfShares"] forState:UIControlStateNormal];
    [_buttonOfAddToMe setImage:[UIImage imageNamed:@"buttonOfFlies"] forState:UIControlStateNormal];
}
@end
